package org.pb;

import java.util.ArrayList;
import java.util.List;


import com.google.android.maps.GeoPoint;
import com.google.android.maps.ItemizedOverlay;
import com.google.android.maps.MapActivity;
import com.google.android.maps.MapView;
import com.google.android.maps.MyLocationOverlay;
import com.google.android.maps.OverlayItem;

import android.app.Activity;
import android.graphics.Canvas;
import android.graphics.drawable.Drawable;
import android.os.Bundle;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class ShowOrder extends MapActivity{
	private TextView regTimestamp;
	private TextView status;
	private TextView comment;
	private TextView executionTimestamp;
	private String latitude;
	private String longitude;
	private MapView mapView;
	private OverlayItem overlayitem  = null;
	private GeoPoint pinPoint;



	/** Called when the activity is first created. */
	@Override
	public void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.showorder);

			
		regTimestamp = (TextView) findViewById(R.id.TextView01);
		status = (TextView) findViewById(R.id.TextView06);
		comment = (TextView) findViewById(R.id.TextView05);
		executionTimestamp = (TextView) findViewById(R.id.TextView04);
	
		Bundle extras = getIntent().getExtras();
		if(extras !=null) {
		regTimestamp.setText(extras.getString("regTimestamp"));
		status.setText(extras.getString("orderStatus"));
		comment.setText(extras.getString("comment"));
		executionTimestamp.setText(extras.getString("executionTimestamp"));
		
		
		latitude=extras.getString("latitude");
		longitude=extras.getString("longitude");
		
		   mapView = (MapView) findViewById(R.id.mapView);
		   mapView.setBuiltInZoomControls(true);
		   
		     Drawable marker=getResources().getDrawable(R.drawable.taxipin);
		     int markerWidth = marker.getIntrinsicWidth();
		     int markerHeight = marker.getIntrinsicHeight();
		     marker.setBounds(0, markerHeight, markerWidth, 0);
		 
		   
		     MyItemizedOverlay myItemizedOverlay = new MyItemizedOverlay(marker);
		     mapView.getOverlays().add(myItemizedOverlay);
		   
		     GeoPoint myPoint1 = new GeoPoint((int)(new Double(latitude)*1000000), (int) (new Double(longitude)*1000000));
			   mapView.getController().setCenter(myPoint1);

		     myItemizedOverlay.addItem(myPoint1, "Cel", "Cel");
		 
		
		
		
		
		
		}

	}



	@Override
	protected boolean isRouteDisplayed() {
		// TODO Auto-generated method stub
		return false;
	}


}
